#define BUFFER_SIZE (52920)
#define BUFFER_MSECS (10)

typedef struct {
	char *data;
	int data_length;
	int seek_offset;
	
	OggVorbis_File oggStream;
	vorbis_info* vorbisInfo;
	vorbis_comment* vorbisComment;
	
	ALuint buffers[2];
	ALuint source;
	ALenum format;
	
	int open;
	int loop;
	SDL_TimerID timer;
} ogg_stream;
	

int ogg_stream_open(ogg_stream *self, char* path, int loop);
void ogg_stream_release(ogg_stream *self);
void ogg_stream_display(ogg_stream *self);
int ogg_stream_play(ogg_stream *self);
void ogg_stream_stop(ogg_stream *self);
void ogg_stream_pause(ogg_stream *self);
void ogg_stream_resume(ogg_stream *self);
int ogg_stream_stopped(ogg_stream *self);
int ogg_stream_paused(ogg_stream *self);
int ogg_stream_playing(ogg_stream *self);
int ogg_stream_update(ogg_stream *self);

int ogg_stream_stream(ogg_stream *self, ALuint buffer);
void ogg_stream_empty(ogg_stream *self);
void ogg_stream_check(ogg_stream *self);
char* ogg_stream_errorString(int code);
